package com.tanhua.server.controller;

import com.tanhua.server.interceptor.UserHolder;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.Map;

@RestController
@RequestMapping("/huanxin")
public class HuanxinController {

    /**
     * 用户登录手机端后   环信会获得用户名密码（假的）完成环信与手机端连接
     * 查询环信用户信息
     * 手机端获取其在环信的账号和密码
     *    账号：“hx”+用id
     *    密码：123456
     */
    @GetMapping("/user")
    public ResponseEntity user() {
        Map map = new HashMap();
        map.put("username","hx"+ UserHolder.getUserId());
        map.put("password","123456");
        return ResponseEntity.ok(map);
    }
}
